package com.dtwave.eureka.controller;


import com.dtwave.eureka.base.BaseController;
import com.dtwave.eureka.entity.User;
import com.dtwave.eureka.entity.dto.UserWxDto;
import com.dtwave.eureka.service.IUserService;
import com.dtwave.eureka.service.feign.FeignUserWxService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 用户信息表 前端控制器
 * </p>
 *
 * @author dtwave
 * @since 2019-05-27
 */
@RestController
@RequestMapping("/user")
@Api("用户信息相关")
public class UserController extends BaseController {

    @Autowired
    private IUserService userService;

    @Autowired
    private FeignUserWxService feignUserWxService;


    @ApiOperation("获取单个用户")
    @GetMapping("/getOne")
    public User getOne() {
        return userService.getById(4360576949425344L);
    }


    @ApiOperation("feign调用，获取用户微信信息")
    @GetMapping("/findUserWx")
    public List<UserWxDto> findSome() {
        return feignUserWxService.list();
    }


}

